package com.yxym.homework05;

public class homework05 {

}
class Test{
    String name = "Rose";
    Test(){
        System.out.println("Test");//（1）
    }
    Test(String name){//name john
        this.name = name;//这里把父类的name修改john
    }
}
class Demo extends Test{
    String name = "jack";
    Demo(){
        super();//寻找父类的构造器
        System.out.println("Demo");//（2）
    }
    Demo(String s){
        super(s);
    }
    public void test(){
        System.out.println(super.name);//(3)Rose (5)john
        System.out.println(this.name);//(4)jack (6)Jack
    }

    public static void main(String[] args) {
        new Demo().test();//匿名对象
        new Demo("john").test();//匿名对象
    }
}
